package com.ioftv.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ioftv.entity.LabelerInfo;
import com.ioftv.mapper.LabelerInfoMapper;
import com.ioftv.service.LabelerInfoService;
import com.ioftv.service.base.BaseService;
import org.springframework.stereotype.Service;

/**
 * 标注员信息Service实现
 */
@Service
public class LabelerInfoServiceImpl extends BaseService<LabelerInfoMapper, LabelerInfo> implements LabelerInfoService {

    @Override
    protected void addUserCondition(LambdaQueryWrapper<LabelerInfo> queryWrapper) {
        queryWrapper.eq(LabelerInfo::getUserId, getCurrentUserId());
    }

    @Override
    protected void setEntityUserId(LabelerInfo entity) {
        if (entity.getUserId() == null) {
            entity.setUserId(getCurrentUserId());
        }
    }
}